
function OnUpdatedPlayerHolstered( oldval, val )

	if( not LocalPlayer().GetActiveWeapon ) then return; end

	local weap = LocalPlayer():GetActiveWeapon();
	
	if( weap and weap:IsValid() and weap:GetTable() and weap:GetTable().Primary ) then
	
		if( weap:GetTable().HolsterToggle ) then
		
			weap:GetTable().HolsterToggle( weap );	
		
		end
	
		if( val ) then
		
			weap:GetTable().Primary.PositionMode = 2;
			weap:GetTable().Primary.PositionMul = 0;
		
		else
		
			weap:GetTable().Primary.GoToOriginalPosition = true;
			weap:GetTable().Primary.NextPositionMode = 0;
		
		end
		
	end
	
	if( ScopeOn ) then
	
		ScopeMode( false );

	end

end


function OnUpdatedPlayerConscious( oldval, val )

	ClientVars["Conscious"] = math.Clamp( math.floor( val ), 1, 100 );
	
	if( val < 45 ) then
	
		if( math.random( 1, 10 ) < 5 ) then
		
			NextAudioHallucinationTime = CurTime();
		
		end
	
	end

end

function OnUpdatedPlayerPhysDesc( oldval, val )

	FormattedPhysDesc = FormatLine( val, "CharCreateEntry", ScrW() * .3 );

end
